package com.stlm2.controller;

import com.stlm2.dems.entity.Entrance;
import com.stlm2.dems.service.EntranceService;
import com.stlm2.util.codecontent.CodeContent;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author：fuchunyu
 * Date：2017/10/20
 * Description：首页入口
 */
@Controller
@RequestMapping("entranceC")
public class EntranceController {

    @Resource
    private EntranceService entranceService;

    @ResponseBody
    @RequestMapping(value = "/getEntrance.json",produces = "application/json;charset=utf-8")
    public String getEntrance(ModelMap model,String companyCode){
        String data=null;
        try {
            data=entranceService.getEntrance(model,true,companyCode);
        }catch (Exception e){
            e.printStackTrace();
            return  CodeContent.getModelByCode(0,"查询失败",data);
        }
        return  data;
    }
}
